home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WAnimation -- Wrapper for the Windows 95 Animation control.
- *
- *
- * Events:
- *
- * AnimationStart --
- *
- * AnimationStop --
- *
- *************************************************************************/
-
- #ifndef _WANIMATE_HPP_INCLUDED
- #define _WANIMATE_HPP_INCLUDED
- #pragma once
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WRESID_HPP_INCLUDED
- # include "wresid.hpp"
- #endif
- #ifndef _WCONTROL_HPP_INCLUDED
- # include "wcontrol.hpp"
- #endif
- #ifndef _WSTRING_HPP_INCLUDED
- # include "wstring.hpp"
- #endif
-
- //
- // Animation styles
- //
-
- #define WSACCenter ((WStyle)0x00000001L) // ACS_CENTER
- #define WSACCentered ((WStyle)0x00000001L) // ACS_CENTER
- #define WSACTransparent ((WStyle)0x00000002L) // ACS_TRANSPARENT
- #define WSACAutoPlay ((WStyle)0x00000004L) // ACS_AUTOPLAY
-
- class WCMCLASS WAnimation : public WControl {
- WDeclareSubclass( WAnimation, WControl );
-
- public:
-
- /************************************************************
- * Constructors and Destructors
- ************************************************************/
-
- WAnimation();
-
- ~WAnimation();
-
- /************************************************************
- * Properties
- ************************************************************/
-
- // AutoPlay
- //
- // If TRUE, animation window automatically plays the
- // animation when it is loaded.
-
- WBool GetAutoPlay() const;
- WBool SetAutoPlay( WBool on );
-
- // Centered
- //
- // If TRUE, animation is centered within the window
- // when played.
-
- WBool GetCentered() const;
- WBool SetCentered( WBool center );
-
- // Transparent
- //
- // If TRUE, animation background is transparent.
-
- WBool GetTransparent() const;
- WBool SetTransparent( WBool transparent );
-
- /*************************************************************
- * Methods
- *************************************************************/
-
- // Close
- //
- // Close a .AVI file/resource.
-
- WBool Close();
-
- // Open
- //
- // Open a .AVI file/resource for playing. The resource can
- // only come from the .EXE resources.
-
- WBool Open( const WChar *aviFileName );
- WBool Open( const WResourceID & id );
-
- // Play
- //
- // Play the opened file numTimeToRepeat times (a value
- // of -1 means play forever) from frame #startFrame
- // to frame #endFrame. Frames are numbered from 0 to
- // 65535. A value of -1 for endFrame means play until
- // the end.
-
- WBool Play( WInt numTimesToRepeat=-1, WShort startFrame=0,
- WShort endFrame=-1 );
-
- // Seek
- //
- // Move to a certain frame in the .AVI clip.
-
- WBool Seek( WShort frame )
- { return Play( 1, frame, frame ); }
-
-
- // Stop
- //
- // Stop playing the .AVI clip.
-
- WBool Stop();
-
- /***************************************************************
- * Overrides
- ***************************************************************/
-
- virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
- void * data=NULL );
-
- virtual WBool ProcessCommand( WUInt id, WNotify code,
- WNotifyInfo info, WLong & returns );
-
- virtual const WChar * InitializeClass();
-
- virtual WStyle GetDefaultStyle() const;
-
- /***************************************************************
- * Data Members
- ***************************************************************/
-
- private:
-
- WString _aviFileName;
- WResourceID _aviID;
- WBool _hasFileName;
- WBool _hasID;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WANIMATE_HPP_INCLUDED
-